#ifndef WIDGET_H
#define WIDGET_H

#include "citycodeacq.h"
#include "Weekend.h"
#include <QWidget>
#include <QMenu>
#include <QNetworkReply>
#include <QLabel>

QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget *parent = nullptr);
    ~Widget();

    void getHttpJsonData(QByteArray httpData);
    void UpDateUI();
    void getWidgetToList();
    void drawTemLineHigh();
    void drawTemLineLow();
    void setWeaTypeIcon();
public slots:
    void OnhttpReply(QNetworkReply* reply);

protected:
    void mousePressEvent(QMouseEvent *event);
    void mouseMoveEvent(QMouseEvent *event) ;
    bool eventFilter(QObject *watched, QEvent *event);

private slots:
    void on_pushButton_Serach_clicked();

    void on_lineEdit_City_returnPressed();

private:
    Ui::Widget *ui;

    QMenu *menu;
    QPoint moveOffset;
    QNetworkReply *reply;
    QNetworkAccessManager *manager;

    CityCodeAcq cityCodeAcq;
    Days days[7];

    QList<QLabel *> weekList;
    QList<QLabel *> dateList;
    QList<QLabel *> weaIconList;
    QList<QLabel *> weaList;
    QList<QLabel *> airList;
    QList<QLabel *> windList;
    QList<QLabel *> windSpeedList;
    QMap<QString,QString> weaTypeMap;
};
#endif // WIDGET_H
